﻿<%@ Page Language="C#" MasterPageFile="~/SiteUser.master" AutoEventWireup="true"
    CodeFile="ViewBoughtCarInsurance.aspx.cs" MaintainScrollPositionOnPostback="true"
    Inherits="carinsurance_ViewBoughtCarInsurance" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="provider_inner">
        <h1>
            Bought - Car Insurance</h1>
        <hr />
        <div class="right_action" style="display: none;">
            <asp:HyperLink runat="server" Visible="false" ID="lnkNewCarUsage" NavigateUrl="#"
                Text="New"></asp:HyperLink>
        </div>
        <fieldset>
            <dl>
                <dt class="top_action">
                    <label>
                        Submitted Date :
                    </label>
                </dt>
                <dd>
                    <asp:DropDownList ID="ddlMonth" runat="server" OnSelectedIndexChanged="ddlMonth_SelectedIndexChanged">
                        <asp:ListItem Value="01">Jan</asp:ListItem>
                        <asp:ListItem Value="02">Feb</asp:ListItem>
                        <asp:ListItem Value="03">Mar</asp:ListItem>
                        <asp:ListItem Value="04">Apr</asp:ListItem>
                        <asp:ListItem Value="05">May</asp:ListItem>
                        <asp:ListItem Value="06">Jun</asp:ListItem>
                        <asp:ListItem Value="07">Jul</asp:ListItem>
                        <asp:ListItem Value="08">Aug</asp:ListItem>
                        <asp:ListItem Value="09">Sep</asp:ListItem>
                        <asp:ListItem Value="10">Oct</asp:ListItem>
                        <asp:ListItem Value="11">Nov</asp:ListItem>
                        <asp:ListItem Value="12">Dec</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlYear" runat="server" OnSelectedIndexChanged="ddlYear_SelectedIndexChanged">
                        <asp:ListItem Value="2010">2010</asp:ListItem>
                        <asp:ListItem Value="2011">2011</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlSubmittedDate" runat="server" AutoPostBack="True" Visible="false"
                        OnSelectedIndexChanged="ddlSubmittedDate_SelectedIndexChanged">
                    </asp:DropDownList>
                    Company Name :
                    <asp:DropDownList ID="ddlProviderCompany" runat="server" OnSelectedIndexChanged="ddlProviderCompany_SelectedIndexChanged">
                        <%--<asp:ListItem Text="Liberty Insurance" Value="29" />--%>
                        <asp:ListItem Text="Etiqa" Value="30" />
                    </asp:DropDownList>
                    Search :
                    <asp:TextBox ID="txtSearch" runat="server" Width="150px" ToolTip="Search by CarId or QuoteRefNo"
                        MaxLength="12" />&nbsp;&nbsp;
                    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
                    &nbsp;
                    <asp:HyperLink ID="hplViewScript" runat="server" Target="_blank">View Script</asp:HyperLink>
                    <div style="display: none;">
                        <asp:TextBox ID="txtSearchKey" runat="server" Text="0"></asp:TextBox>
                    </div>
                </dd>
            </dl>
        </fieldset>
        <hr />
        <asp:GridView ID="grvCarInsurance" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CellPadding="2" EmptyDataText="There are no data records to display." CssClass="progridstyle"
            SelectedRowStyle-CssClass="progridodd" GridLines="None" AllowSorting="True" OnPageIndexChanged="grvCarInsurance_PageIndexChanged"
            PagerStyle-CssClass="pgrpro" DataSourceID="sqlDsCarInsurance" DataKeyNames="CECarMoreDetailId,CECarId,RefCEUserId,ContactNo,QuoteRefNo"
            OnSelectedIndexChanged="grvCarInsurance_SelectedIndexChanged">
            <Columns>
                <asp:BoundField DataField="CECarMoreDetailId" HeaderText="CECarMoreDetailId" SortExpression="CECarMoreDetailId"
                    Visible="false" InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="CECarId" HeaderText="CarId" SortExpression="CECarId" Visible="false"
                    InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="RefCEUserId" HeaderText="RefCEUserId" Visible="false"
                    SortExpression="RefCEUserId" />
                <asp:BoundField DataField="ProviderCompanyId" HeaderText="ProviderCompanyId" Visible="false"
                    SortExpression="ProviderCompanyId" />
                <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName"
                    Visible="false" />
                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                <asp:BoundField DataField="ContactNo" HeaderText="Contact No" SortExpression="ContactNo" />
                <asp:BoundField DataField="MakeModelDesc" HeaderText="Make/Model" SortExpression="MakeModelDesc" />
                <asp:BoundField DataField="VechicleNo" HeaderText="Vechicle No" SortExpression="VechicleNo" />
                <asp:BoundField DataField="QuoteRefNo" HeaderText="QuoteRefNo" SortExpression="QuoteRefNo" />
                <asp:BoundField DataField="SubmittedTime" HeaderText="Submitted Date/Time" SortExpression="SubmittedTime"
                    DataFormatString="{0:dd/MMM/yyyy hh:mm:ss tt}" />
                <asp:CommandField ShowSelectButton="True" />
            </Columns>
            <FooterStyle />
            <PagerStyle />
            <SelectedRowStyle CssClass="progridover" />
            <HeaderStyle CssClass="progridheader" />
            <EditRowStyle />
            <AlternatingRowStyle CssClass="progridodd" />
            <RowStyle CssClass="progrideven" />
        </asp:GridView>
        <asp:SqlDataSource ID="sqlDsCarInsurance" runat="server" ConnectionString="<%$ ConnectionStrings:CX_CRMDBConnectionString %>"
            SelectCommand="sprocCarInsuranceBoughtUserListSelectBySubmittedDate" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <%--<asp:ControlParameter ControlID="ddlSubmittedDate" Name="SubmittedDate" PropertyName="SelectedValue" Type="String" />--%>
                <asp:ControlParameter ControlID="txtSubmittedDate" Name="SubmittedDate" PropertyName="Text"
                    Type="String" />
                <asp:ControlParameter ControlID="ddlProviderCompany" Name="ProviderCompanyId" PropertyName="SelectedValue"
                    Type="Int64" />
                <asp:ControlParameter ControlID="txtSearchKey" DefaultValue="0" Name="SearchKey"
                    PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
        <br />
        <hr />
        <br />
        <div id="divCallPA" runat="server">
            <span id="newbtn"><span class="newbutton">
                <asp:HyperLink ID="hplPANewQuote" Target="_blank" runat="server" Text="RUN NEW PA Quote" />
            </span>&nbsp;&nbsp;&nbsp; <span class="newbutton">
                <asp:HyperLink ID="hplPANewUser" Target="_blank" runat="server" Text="PA New Customer And Quote" />
            </span></span>
            <asp:HyperLink ID="hplPAViewScript" NavigateUrl="~/script/eTiQa_ePA_agents.pdf" runat="server"
                Target="_blank">View PA Packages</asp:HyperLink>
            <br />
        </div>
        <br />
        <hr />
        <br />
        <div id="divCallStatus" style="float: left;" runat="server" visible="false">
            <asp:Label ID="Label1" runat="server" Text="Call Status" Font-Size="Large" Font-Bold="true" />
            <table cellpadding="5" cellspacing="5" width="100%">
                <tr>
                    <td>
                        Status
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlCallStatus" runat="server">
                            <asp:ListItem Text="Select" Value="-1" />
                            <asp:ListItem Text="Positive" Value="1" />
                            <asp:ListItem Text="Negative" Value="0" />
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator Display="Dynamic" runat="server" ValidationGroup="callstatus"
                            ID="rfvCallStatus" ControlToValidate="ddlCallStatus" InitialValue="-1" ErrorMessage="Please select." />
                        <asp:Label runat="server" ID="lblCallStatusMessage" Font-Bold="true" ForeColor="Red" />
                    </td>
                </tr>
                <tr>
                    <td>
                        Remark
                    </td>
                    <td>
                        :
                    </td>
                    <td>
                        <asp:TextBox runat="server" TextMode="MultiLine" Height="100px" Width="700px" ID="txtRemark" />
                        <asp:Button runat="server" ValidationGroup="callstatus" ID="btnCallStatus" Text="Submit"
                            OnClick="btnCallStatus_Click" Width="61px" OnClientClick="return SubmitConfirm()" />
                        <%--OnClientClick="javascript:return confirm('Confirm to submit?');"--%>
                    </td>
                </tr>
                <tr>
                    <td>
                    </td>
                    <td>
                    </td>
                    <td>
                    </td>
                </tr>
            </table>
            <div style="display: none;">
                <asp:TextBox runat="server" ID="txtCallStatusId" Text="0"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtCarId" Text="0"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtProviderCompanyId" Text="0"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtCustomerId" Text="0"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtContactNo" Text="0"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtCIQuoteRefNo" Text="0"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtAgentId" Text="0"></asp:TextBox>
                <asp:TextBox runat="server" ID="txtSubmittedDate" Text="201104"></asp:TextBox>
            </div>
        </div>
    </div>
    <br />
    <br />

    <script type="text/jscript">
        function SubmitConfirm() {
            var _retVal = false;
            if (Page_ClientValidate('callstatus')) {
                _retVal = confirm('Confirm to submit');
            }
            else {
                ShowDiv();
            }
            return _retVal;
        }
    </script>

</asp:Content>
